<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('任务创建')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            任务标题：<input type="text" name="taskTitle"/>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="cyq:task:add">
                <i class="fa fa-plus"></i> 新增
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('cyq:task:edit')}]];
    var removeFlag = [[${@permission.hasPermi('cyq:task:remove')}]];
    var checkFlag = [[${@permission.hasPermi('cyq:task:check')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "cyq/task/postpone";

    $(function() {
        var options = {
            url: prefix + "/list1",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/check/{id}",
            sortName: "createBy",
            pageSize: 5,
            pageList: [5,10,15],
            modalName: "任务延期",
            columns: [
                {
                    field: 'applyUserName',
                    title: '申请人',
                    sortable: true
                },
                {
                    field: 'postPoneTime',
                    title: '延期至(日期)',
                    sortable: true
                },
                {
                    field: 'postPoneCause',
                    title: '申请原因',
                },
                {
                    field: 'postPoneStatus',
                    title: '批复状态',
                    formatter:function(value,row,index){
                        if(value === 1){
                            return "同意";
                        }
                        else if(value === 2){
                            return  "不同意";
                        }
                        else if(value === 3){
                            return "审批中";
                        }
                    },
                },
                {
                    field: 'checkTime',
                    title: '批复时间',
                    sortable: true
                },
                {
                    field: 'checkUserName',
                    title: '批复人',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.taskId + '\')"><i class="fa fa-edit"></i>批复</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.taskId + '\')"><i class="fa fa-remove"></i>删除</a> ');
                        actions.push('<a class="btn btn-warning btn-xs ' + checkFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.taskId + '\')"><i class="fa fa-search"></i>查看</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });




</script>
</body>
</html>